package adv7;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;

public class SetOut {

	public static void main(String[] args) {
		// 1-10000之间的质数写入文件
		try {// 输出流重定向
			System.setOut(new PrintStream(new FileOutputStream("zhishu.txt")));
		} catch (FileNotFoundException e) {
			// TODO 自动生成的 catch 块
			e.printStackTrace();
		}
		for (int i = 1; i <= 10000; i++) {
			System.out.print(i + " ");
			if (i % 10 == 0)
				System.out.println();
		}
	}
}
